<#setting number_format="#">
<#macro fieldCtrl field type entName readonly isAttr>
    <${field.control} class="${field.control}" isattr="${isAttr}" type="${type}" ctltype="${field.control}" style="width:100%" :data="data"
    <@attrJson field=field type=type entName=entName readonly=readonly/>
    ></${field.control}>
</#macro>
<#macro attrJson field type entName readonly>
    :readonly="${readonly???string(readonly,'readonly')}" ctlid="${field.id}"
    <#if (type=='main')>
        id="${util.randomId()}" :permission="permission.${field.name}" v-model="data.${field.name}"
        :valid="validFunc('main','${field.name}')"
        v-on:enter="enter('main','${field.name}')"
        v-on:valuechange="valuechange('main','${field.name}')"
    <#elseif (type=='onetoone')>
        id="${field.name}${field.id}"
        :permission="permission.sub__${entName}.${field.name}"
        :valid="validFunc('${entName}','${field.name}',item)"
        v-model="data.sub__${entName}.${field.name}"
        v-on:enter="enter('${entName}','${field.name}',item)"
        v-on:valuechange="valuechange('${entName}','${field.name}',item)"
    <#else>
        id="${field.name}${field.id}"
        :permission="permission.sub__${entName}.${field.name}" v-model="item.${field.name}" :data="item"
        :valid="validFunc('${entName}','${field.name}',index)"
        v-on:enter="enter('${entName}','${field.name}',item)"
        v-on:valuechange="valuechange('${entName}','${field.name}',item)"
        length="${field.length}" from="input"
    </#if>
</#macro>
<#macro fieldReqired field >
    <#if field.isNotNull==1>:class="{required:required.main && required.main.${field.name}}" class="editRequired"</#if>
</#macro>
<#macro fieldReqiredOneToOne tableName field >
    <#if field.isNotNull==1>:class="{required:required.${tableName} && required.${tableName}.${field.name}}" class="editRequired"</#if>
</#macro>
<#macro fieldReqiredOneToMany tableName field >
    <#if field.isNotNull==1>:class="{required:required.${tableName} && required.${tableName}.${field.name}}" class="editRequired"</#if>
</#macro>




